package travlefate.story.fragment;

import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ListView;

import com.handmark.pulltorefresh.library.PullToRefreshListView;

import travlefate.story.R;
import travlefate.story.adapter.FriendAdapter;
import travlefate.story.base.BaseFragment;

/**
 * @author keven
 * @data 15/12/23 下午12:10
 * @package travlefate.story.fragment
 * 好友列表
 */

public class FragmentFriend extends BaseFragment {

    private PullToRefreshListView mRecycleView;
    private FriendAdapter mAdapter;
    private View mHeadView,mFootView;

    @Override
    protected void initDatas() {
        ListView refreshableView = mRecycleView.getRefreshableView();

        mAdapter = new FriendAdapter();

        mRecycleView.setAdapter(mAdapter);
        refreshableView.addHeaderView(mHeadView);
        refreshableView.addFooterView(mFootView);


    }

    @Override
    protected void initClick() {

    }

    @Override
    protected void initViews(View view) {
        mRecycleView = (PullToRefreshListView) view.findViewById(R.id.friend_list);

        mHeadView = LayoutInflater.from(getActivity()).inflate(R.layout.type_friend_head, null);
        mFootView = LayoutInflater.from(getActivity()).inflate(R.layout.type_foot, null);
    }

    @Override
    protected View initLayout(ViewGroup container) {
        return LayoutInflater.from(container.getContext()).inflate(R.layout.fragment_friend, null);
    }
}
